bitkeeper revision 1.1661 (42a03d7dMwgNdNW-UfchOZEUQsYy9w)
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 3 Jun 2005 11:22:37 +0000 (11:22 +0000)
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 3 Jun 2005 11:22:37 +0000 (11:22 +0000)
Make sure we only look at the unpinned list for mms which are actually
unpinned.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c

index 675509e0bee40c968bdb0abc1c7ed501986efe4f..363010f1ed1751d7649d91c6d45fbb2cd0d8a404 100644 (file)
@@ -134,9 +134,11 @@ void destroy_context(struct mm_struct *mm)
                        kfree(mm->context.ldt);
                mm->context.size = 0;
        }
-       spin_lock(&mm_unpinned_lock);
-       list_del(&mm->context.unpinned);
-       spin_unlock(&mm_unpinned_lock);
+       if (!mm->context.pinned) {
+               spin_lock(&mm_unpinned_lock);
+               list_del(&mm->context.unpinned);
+               spin_unlock(&mm_unpinned_lock);
+       }
 }
 
 static int read_ldt(void __user * ptr, unsigned long bytecount)